//
//  ServiceRootNewsViewController.swift
//  KaMengApplication
//
//  Created by DUONIU_MAC on 2018/10/22.
//  Copyright © 2018年 DUONIU_MAC. All rights reserved.
//

import UIKit
import XLPagerTabStrip

class ServiceRootNewsViewController: InformationPageViewController {
    
    //综合资讯
    fileprivate var headLineView = HeadlineView()

    override func viewDidLoad() {
        super.viewDidLoad()

    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
    }
    
    //MARK: 更多标签
    override func moreLabel() {
        let dataArray = [pinCard,late,bill,activated,annualFee,blacklist,handlingFee,integral,changeCard,preferential,amountRaise,hotel,tourism,consumption,popularBank,seaAmoy,safety,overdraft,cost,application,stages,repayment,cashWithdrawal,loss,creditCardLimit,rersonalCredit,integral,shopping]
        
        let moreLabelVC = MoreLabelViewController.init(dataArray: dataArray)
        moreLabelVC.labelBlock = {(index) in
            self.moveToViewController(at: index.row, animated: true) //切换至选择标签
        }
        self.present(moreLabelVC, animated: false, completion: nil)
    }
    
    
    //MARK: 滑动的子控制
    override func viewControllers(for pagerTabStripController: PagerTabStripViewController) -> [UIViewController] {
        
        let titleArray = [pinCard,late,bill,activated,annualFee,blacklist,handlingFee,integral,changeCard,preferential,amountRaise,hotel,tourism,consumption,popularBank,seaAmoy,safety,overdraft,cost,application,stages,repayment,cashWithdrawal,loss,creditCardLimit,rersonalCredit,integral,shopping]
        let urlArray = ["1","2","3","4","5","6","7","8","9","34","33","50","49","48","47","46","45","44","43","42","41","40","39","38","37","36","35","51"]
        
        var viewControllers = [UIViewController]()
        
        for i in 0..<titleArray.count {
            let serviceNewsVC = ServiceNewsViewController.init(urlString: urlArray[i])
            serviceNewsVC.itemInfo.title = titleArray[i]
            viewControllers.append(serviceNewsVC)
        }
        
        return viewControllers
    }
    

}
